using System.Collections;
using System.Collections.Generic;
using UnityEngine;


public enum AnimationEventType
{
    Enemy_Animation = 1,
    Player_Animation = 2,
}
//动画事件组件，直接挂载到animator同节点下，并添加到动画中的事件，会使用事件系统来发送事件，监听事件系统并判断animationEventType即可获取动画事件 
public class AnimationEventComponent : MonoBehaviour
{
    public void AnimationEventCallBack(int animationEventType)
    {
        AnimationEventOnEvent animationEventOnEvent = new AnimationEventOnEvent();
        animationEventOnEvent.animationEventType = animationEventType;
        animationEventOnEvent.animator = GetComponent<Animator>();
        EventManager.Instance.Fire(this,animationEventOnEvent);
    }
}
